package com.headcaselabs.queue.message;

import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;

import com.thoughtworks.xstream.XStream;


public class FinishedJobReport extends Report {
	
	private List<String> executionTimes;
	private List<Boolean> success;
	private List<String> queues;
	private Integer completedJobs;
	private String messageId;
	private Hashtable<String,Integer> queueAccessCounts;
	
	public FinishedJobReport(String topic) {
		tasks = new LinkedList<String>();
		executionTimes = new LinkedList<String>();
		success = new LinkedList<Boolean>();
		queues = new LinkedList<String>();
		this.topic = topic;
		this.queueAccessCounts = new Hashtable<String, Integer>();
	}

	/**
	 * @return the executionTimes
	 */
	public List<String> getExecutionTimes() {
		return executionTimes;
	}

	/**
	 * @param executionTimes the executionTimes to set
	 */
	public void setExecutionTimes(List<String> executionTimes) {
		this.executionTimes = executionTimes;
	}


	/**
	 * @return the queues
	 */
	public List<String> getQueues() {
		return queues;
	}

	/**
	 * @param queues the queues to set
	 */
	public void setQueues(List<String> queues) {
		this.queues = queues;
	}

	/**
	 * @return the success
	 */
	public List<Boolean> getSuccess() {
		return success;
	}

	/**
	 * @param success the success to set
	 */
	public void setSuccess(List<Boolean> success) {
		this.success = success;
	}
	
	/**
	 * @return the messageId
	 */
	public String getMessageId() {
		return messageId;
	}

	/**
	 * @param messageId the messageId to set
	 */
	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	/**
	 * @return the completedJobs
	 */
	public Integer getCompletedJobs() {
		return completedJobs;
	}

	/**
	 * @param completedJobs the completedJobs to set
	 */
	public void setCompletedJobs(Integer completedJobs) {
		this.completedJobs = completedJobs;
	}

	

	public String toXml() {
		XStream xstream = new XStream();

		xstream.alias("report", Report.class);
		xstream.alias("finishedReport", FinishedJobReport.class);
		String xml = xstream.toXML(this);
		return xml;
	}

	/**
	 * @generated by CodeSugar http://sourceforge.net/projects/codesugar */
	
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("[FinishedJobReport:");
		buffer.append(" tasks: ");
		buffer.append(tasks);
		buffer.append(" executionTimes: ");
		buffer.append(executionTimes);
		buffer.append(" success: ");
		buffer.append(success);
		buffer.append(" queues: ");
		buffer.append(queues);
		buffer.append(" completedJobs: ");
		buffer.append(completedJobs);
		buffer.append(" time: ");
		buffer.append(time);
		buffer.append(" from: ");
		buffer.append(from);
		buffer.append(" messageId: ");
		buffer.append(messageId);
		buffer.append(" topic: ");
		buffer.append(topic);
		buffer.append("]");
		return buffer.toString();
	}

	/**
	 * @return the queueAccessCounts
	 */
	public Hashtable<String, Integer> getQueueAccessCounts() {
		return queueAccessCounts;
	}

	/**
	 * @param queueAccessCounts the queueAccessCounts to set
	 */
	public void setQueueAccessCounts(Hashtable<String, Integer> queueAccessCounts) {
		this.queueAccessCounts = queueAccessCounts;
	}

	
}
